﻿/// <reference path="//Microsoft.WinJS.1.0/js/base.js" />

WinJS.Namespace.define("requestsNs", {
    Requester: WinJS.Class.define(
        function RequesterConstructor(url) {
            this.url = url;
        },
        {
            getRequest: function () {
                return WinJS.xhr({
                    type: "GET",
                    url: this.url,
                    headers: { "Content-type": "application/json" },
                    responseType: "json",
                });
            },
            postRequest: function (jsonData) {
                return WinJS.xhr({
                    url: this.url,
                    type: "POST",
                    data: JSON.stringify(jsonData),
                    headers: { "Content-type": "application/json" },
                });
            },
        },
        {

        }),
});